using UnityEngine;
using System.Collections;

public class Emission : MonoBehaviour {

    public float i;

    void Start()
    {
        transform.localScale = new Vector3(0, 0, transform.localScale.z);
    }

    void Update()
    {
        i += 0.5f * Time.deltaTime;

        transform.localScale = new Vector3(i,i,transform.localScale.z);
        transform.Rotate(0, 0, 1);
        renderer.material.color = new Color(renderer.material.color.r, renderer.material.color.g, renderer.material.color.b, 0.5f - i);

        if (i > 0.5f)
        {
            Destroy(gameObject); 
        }
    }
}
